{
 "metadata": {
  "name": "op2_demo"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import os\nimport copy\nfrom numpy import abs\n\nfrom pyNastran.utils import print_bad_path\nfrom pyNastran.op2.op2 import OP2\nfrom pyNastran.utils import object_methods",
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# define the object\n# define the input file using the GUI\n#op2 = OP2()",
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#op2_filename = r'D:\\work\\pynastran_0.7.0_py27\\models\\iSat\\ISat_Launch_Sm_Rgd.op2'\n#op2_filename = r'D:\\work\\pynastran_0.7.0_py27\\models\\iSat\\ISat_Launch_Sm_4pt.op2'\nop2_filename = r'C:\\Users\\Steve\\Dropbox\\pyNastran_examples\\iSat\\ISat_Launch_Sm_4pt.op2'\n#assert os.path.exists(op2_filename), print_bad_path(op2_filename)\n\n# define the input file with a file path\nop2 = OP2(op2_filename)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=100    set_subcases - subcases = []\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=147    op2FileName = C:\\Users\\Steve\\Dropbox\\pyNastran_examples\\iSat\\ISat_Launch_Sm_4pt.op2\n"
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# read the op2\nop2.read_op2()",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = GEOM1\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'GEOM1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'GEOM1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = GEOM2\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'GEOM2'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'GEOM2'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = GEOM4\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'GEOM4'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'GEOM4'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = EPT\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'EPT'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'EPT'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = MPTS\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'MPTS'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'MPTS'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = DYNAMICS\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'DYNAMICS'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'DYNAMICS'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = OUGV1\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'OUGV1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'OUGV1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = OEF1X\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'OEF1X'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'OEF1X'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=779    --------------------------------------------------------------------------------\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "table_name = OES1X1\nDEBUG:     fname=op2.pyc                   lineNo=795    table_name = |u'OES1X1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=oes_objects.pyc           lineNo=36     starting OES...element_name=CQUAD4 isubcase=1\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=967    *** finished table_name = |u'OES1X1'|\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "DEBUG:     fname=op2.pyc                   lineNo=803    ---end of all tables---\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "print op2.get_op2_stats()",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "op2.eigenvectors[1]\n  modes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167]\n  eigrs = [2757.90, 3568.14, 9686.19, 16154.82, 16277.98, 16668.71, 18248.49, 18591.64, 18617.25, 31941.08, 34933.99, 40398.03, 105008.77, 109650.68, 113132.63, 113452.42, 135065.92, 150334.17, 174828.88, 190511.33, 247263.61, 248143.77, 249965.06, 252641.45, 267358.47, 304008.84, 309014.47, 318438.62, 338565.28, 351562.88, 352142.56, 384596.44, 385292.19, 412883.31, 420803.19, 506141.09, 512093.44, 550447.44, 582285.19, 596320.06, 619492.44, 635656.38, 714533.62, 717138.88, 789258.06, 789476.81, 812667.81, 829758.62, 836560.88, 845340.12, 845480.88, 921841.25, 963763.69, 966138.69, 972040.56, 976769.25, 1009583.56, 1012155.69, 1070493.88, 1091504.38, 1180308.62, 1300223.12, 1373967.75, 1443581.88, 1481970.75, 1556274.12, 1564383.88, 1608944.00, 1620584.62, 1680112.88, 1756365.88, 1856927.88, 1872126.12, 1881246.38, 1891905.88, 1898146.12, 1927499.12, 2005625.38, 2015030.38, 2024489.38, 2058723.75, 2086919.75, 2292276.25, 2377601.75, 2411275.25, 2465905.00, 2572223.75, 2628440.25, 2658697.00, 2710866.25, 2746213.75, 2771100.25, 2798177.75, 2813809.75, 2835751.75, 2904842.50, 2907620.75, 2940572.75, 2952325.75, 2999655.00, 3014211.75, 3091793.50, 3156497.50, 3274113.00, 3316722.25, 3335977.00, 3442247.75, 3481244.50, 3519034.00, 3552202.00, 3559618.50, 3568005.50, 3666521.50, 3710735.25, 3811038.00, 3823744.25, 3836552.00, 3841662.50, 3870521.25, 3914867.25, 3982016.75, 4066024.50, 4070877.75, 4122935.00, 4126467.50, 4221192.00, 4229641.00, 4256011.00, 4260633.50, 4313936.00, 4333984.50, 4451747.00, 4475993.50, 4484877.50, 4520981.50, 4567997.00, 4571887.00, 4706792.00, 4741043.50, 4823977.50, 4918528.50, 4957954.00, 5091365.50, 5100135.00, 5104857.00, 5111415.00, 5254366.50, 5338743.00, 5373314.00, 5398579.50, 5540606.50, 5585602.50, 5691630.00, 5692052.50, 5697376.50, 5722091.00, 5737279.50, 5782437.00, 5860846.50, 5920603.50, 6020617.50, 6035178.00, 6037030.00, 6102521.00, 6162773.50, 6169898.50, 6229583.00]\n  mode_cycles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n  type=EigenVectorObject ntimes=167 ngrids=5379\n  translations, rotations, gridTypes\n\nop2.plateStress[1]\n  modes = [1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167]\n  mode_cycles = [0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00]\n  type=PlateStressObject ntimes=167 nelements=4612\n  eType, fiberCurvature, oxx, oyy, txy, angle, majorP, minorP, ovmShear\n\nop2.barForces[1]\n  modes = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167]\n  type=RealCBarForce ntimes=167 nelements=827\n  bendingMomentA, bendingMomentB, shear, axial, torque\n\n\n"
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# what modes did we analyze:  1 to 167\nprint \"loadcases =\", op2.eigenvectors.keys()\n\n# get subcase 1\neig1 = op2.eigenvectors[1]\n\nmodes = eig1.translations.keys()\n\nprint \"modes =\", modes, '\\n'\n\nmode2 = eig1.translations[2]\nmode2_node10 = mode2[10]\nprint \"translation mode2_node10 =\", mode2_node10\nprint \"rotations mode2_node10 =\", eig1.rotations[2][10]",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "loadcases = [1]\nmodes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167] \n\ntranslation mode2_node10 = [  1.69552350e-05   7.93729909e-03   1.50962302e-03]\nrotations mode2_node10 = [ -2.24097050e-04   1.22839128e-06  -1.18710750e-06]\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "plate_stress = op2.plateStress[1]\nprint \"plate_stress_obj =\", type(plate_stress), '\\n'\n\n# the set of variables in the PlateStressObject\nprint \"plate_stress = \", plate_stress.__dict__.keys(), '\\n'\n\n# list of parameters that define the object (e.g. what is the nonlinear variable name\nprint \"data_code_keys = \", plate_stress.data_code.keys(), '\\n'\n\n# nonlinear variable name\nname = plate_stress.data_code['name']\nprint \"name = %r\" % plate_stress.data_code['name']\n\nprint \"list-type variables =\", plate_stress.data_code['dataNames']\n\n# the special loop parameter\n# for modal analysis, it's \"modes\"\n# for transient, it's \"dts\"\nprint \"modes = \", plate_stress.modes # name + 's'\n\n\n# extra list-type parameter for modal analysis; see dataNames\n#print \"mode_cycles =\", plate_stress.mode_cycles\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "plate_stress_obj = <class 'pyNastran.op2.tables.oes_stressStrain.real.oes_plates.PlateStressObject'> \n\nplate_stress =  ['code', 'subtitle', 'stress_bits', 'load_set', 'thermal', 's_code', 'txy', 'fiberCurvature', 'isubcase', 'angle', 'element_name', 'add_new_eid', 'nonlinear_factor', 'log', 'oyy', 'minorP', 'isTransient', 'mode_cycles', 'sort_bits', 'label', 'add', 'num_wide', 'mode', 'format_code', 'device_code', 'majorP', 'dataNames', 'eType', 'oxx', 'dt', 'modes', 'mode_cycle', 'name', 'analysis_code', 'table_code', 'element_type', 'table_name', 'data_code', 'sort_code', 'addNewNode', 'ovmShear'] \n\ndata_code_keys =  [u'subtitle', u'stress_bits', u'load_set', u'thermal', u's_code', u'element_name', u'nonlinear_factor', u'log', u'sort_bits', u'label', u'num_wide', u'format_code', u'device_code', u'dataNames', u'dt', u'mode_cycle', u'name', u'analysis_code', u'table_code', u'element_type', u'table_name', u'mode', u'sort_code'] \n\nname = u'mode'\nlist-type variables = [u'mode', u'eigr', u'mode_cycle']\nmodes =  [1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167]\n"
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "def abs_max_min(vals):\n    absvals = list(abs(vals))\n    maxval = max(absvals)\n    i = absvals.index(maxval)\n    return vals[i]\n\nprint \"methods =\", object_methods(plate_stress)\nif plate_stress.isVonMises():  # True\n    ovm = plate_stress.ovmShear\nelse:\n    oMaxShear = plate_stress.ovmShear\n\n#ovm.keys()  # modes 1-6\n#ovm[6].keys()  # elements 1-3277\nprint \"\"\nprint \"[layer1, layer2, ...] =\", ovm[6][1000]['C'] \novm_mode6_eid1000 = abs_max_min(ovm[6][1000]['C'])\nprint \"ovm_mode6_eid1000 =\", ovm_mode6_eid1000",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "methods = ['add', 'addNewNode', 'addNewNodeSort1', 'add_f06_data', 'add_new_eid', 'add_new_eid_sort1', 'add_new_transient', 'add_sort1', 'append_data_member', 'apply_data_code', 'code_information', 'delete_transient', 'getHeaders', 'getOrderedETypes', 'getUnsteadyValue', 'getVar', 'get_data_code', 'get_element_type', 'get_stats', 'get_transients', 'isCurvature', 'isCurvatureOld', 'isFiberDistance', 'isImaginary', 'isMaxShear', 'isRandomResponse', 'isReal', 'isRealImaginaryOrMagnitudePhase', 'isRealOrRandom', 'isSort2', 'isSortedResponse', 'isStrain', 'isStress', 'isThermal', 'isVonMises', 'is_magnitude_phase', 'is_real_imaginary', 'is_sort1', 'print_data_members', 'print_table_code', 'recastGridType', 'set_data_members', 'set_var', 'start_data_member', 'update_data_code', 'update_dt', 'writeF06_Quad4_Bilinear', 'writeF06_Quad4_BilinearTransient', 'writeF06_Tri3', 'writeF06_Tri3Transient', 'write_f06', 'write_matlab']\n\n[layer1, layer2, ...] = [1146.9427490234375, 1720.633056640625]\novm_mode6_eid1000 = 1720.63305664\n"
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# see the difference between \"transient\"/\"modal\"/\"frequency\"-style results\n# and \"nodal\"/\"elemental\"-style results\n\nimode = 6  # mode 6; could just as easily be dt\niele = 10  # element 10\ninode = 'C'\nilayer = 1\n\n# result[imode][ielement][ilayer]\nprint \"ps.mode_cycle =\", plate_stress.mode_cycles[imode]\nprint \"oxx =\", plate_stress.oxx[imode][iele][inode][ilayer]\nprint \"oyy =\", plate_stress.oyy[imode][iele][inode][ilayer]\nprint \"txy =\", plate_stress.txy[imode][iele][inode][ilayer]\nprint \"omax =\", plate_stress.majorP[imode][iele][inode][ilayer]\nprint \"omin = \", plate_stress.minorP[imode][iele][inode][ilayer]\nprint \"ovm/maxShear =\", plate_stress.ovmShear[imode][iele][inode][ilayer]\n\n# result[imode][ielement][inode][ilayer]\nif plate_stress.isFiberDistance():\n    print \"fiberDistance =\", plate_stress.fiberCurvature[iele][inode][ilayer]\nelse:\n    print \"curvature =\", plate_stress.fiberCurvature[iele][inode][ilayer]",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "ps.mode_cycle = 0.0\noxx = 18.8725357056\noyy = 20.1630306244\ntxy = 8.30984687805\nomax = 27.8526439667\nomin =  11.1829223633\novm/maxShear = 24.2766056061\nfiberDistance = -0.40000000596\n"
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# write the F06 with Real/Imaginary or Magnitude/Phase\n# only matters for complex results\nop2.write_f06(r'C:\\Users\\Steve\\Desktop\\isat.f06', is_mag_phase=False, make_file=True, delete_objects=True)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "EigenVectorObject\nRealCBarForce"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "\nPlateStressObject\n"
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}